{% extends 'base.html' %}
{% block title %}
    高中成绩处理
{% endblock %}
{% block head %}
    <style>
        th, td {
            text-align: center;
            color: #6a1a21;
        }
    </style>
{% endblock %}
{% block content %}
    <div class="container mt-3">
        <div class="row">
            <div class="col mx-auto" style="max-width: 800px">
                <label for="" class="mx-auto h5 text-warning">按有效分统计:请选择有效的excel格式文件</label>
                <form action="{{ url_for('process_by_good_scores') }}" method="post" enctype="multipart/form-data">
                    <div class="input-group mb-3">
                        <label class="col mx-auto" style="width:800px">
                            <input type="file" class="form-control" placeholder="请输入原始成绩路径"
                                   aria-describedby="input" name="path_file" value="{{ path_file }}">
                            <span class="text-warning">请输入历史类各科有效分数:</span>
                            <input type="text" class="form-control" placeholder="请输入历史类语文有效分"
                                   aria-describedby="input" name="h_chinese" value="{{ h_chinese }}">
                            <input type="text" class="form-control" placeholder="请输入历史类数学有效分"
                                   aria-describedby="input" name="h_math" value="{{ h_math }}">
                            <input type="text" class="form-control" placeholder="请输入历史类英语有效分"
                                   aria-describedby="input" name="h_english" value="{{ h_english }}">
                            <input type="text" class="form-control" placeholder="请输入历史类历史有效分"
                                   aria-describedby="input" name="h_history" value="{{ h_history }}">
                            <input type="text" class="form-control" placeholder="请输入历史类政治有效分"
                                   aria-describedby="input" name="h_politics" value="{{ h_politics }}">
                            <input type="text" class="form-control" placeholder="请输入历史类地理有效分"
                                   aria-describedby="input" name="h_geography" value="{{ h_geography }}">
                            <input type="text" class="form-control" placeholder="请输入历史类生物有效分"
                                   aria-describedby="input" name="h_biology" value="{{ h_biology }}">
                            <input type="text" class="form-control" placeholder="请输入历史类总分有效分"
                                   aria-describedby="input" name="h_total" value="{{ h_total }}">
                            <span  class="text-warning">请输入物理类各科有效分数:</span>
                            <input type="text" class="form-control" placeholder="请输入物理类语文有效分"
                                   aria-describedby="input" name="p_chinese" value="{{ p_chinese }}">
                            <input type="text" class="form-control" placeholder="请输入物理类数学有效分"
                                   aria-describedby="input" name="p_math" value="{{ p_math }}">
                            <input type="text" class="form-control" placeholder="请输入物理类英语有效分"
                                   aria-describedby="input" name="p_english" value="{{ p_english }}">
                            <input type="text" class="form-control" placeholder="请输入物理类物理有效分"
                                   aria-describedby="input" name="p_physics" value="{{ p_physics }}">
                            <input type="text" class="form-control" placeholder="请输入物理类化学有效分"
                                   aria-describedby="input" name="p_chemistry" value="{{ p_chemistry }}">
                            <input type="text" class="form-control" placeholder="请输入物理类政治有效分"
                                   aria-describedby="input" name="p_politics" value="{{ p_politics }}">
                            <input type="text" class="form-control" placeholder="请输入物理类地理有效分"
                                   aria-describedby="input" name="p_geography" value="{{ p_geography }}">
                            <input type="text" class="form-control" placeholder="请输入物理类生物有效分"
                                   aria-describedby="input" name="p_biology" value="{{ p_biology }}">
                            <input type="text" class="form-control" placeholder="请输入物理类总分有效分"
                                   aria-describedby="input" name="p_total" value="{{ p_total }}">
                        </label>
                        <button type="submit" class="btn btn-outline-info" id="input">查看</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
    {% if good_history_html %}
        <div class="container mt-sm-2">
            <div class="row">
                <div class="col h3 text-center text-black-50">
                    数据更新时间：{{ update_time }}
                    <br>
                    <hr>
                    数据来源：{{ path_file.filename }}
                    <br>
                    历史类上线总分：{{ h_total }}
                    <br>
                    物理类上线总分：{{ p_total }}
                    <hr>
                </div>
            </div>
        </div>

        <div class="container mt-5 text-center">
            <div class="row">
                <div class="col">
                    <h3>历史类成绩数据统计分析</h3>
                </div>
            </div>
        </div>
    {% else %}
        <div class="container mt-5 text-center text-warning">
            <div class="row">
                <div class="col h4">
                    {{ weekday }}
                </div>
                </div>
            </div>
        </div>
    {% endif %}
    <div class="container mt-3">
        <div class="row">
            <div class="col text-center table-responsive text-nowrap">
                <hr>
                <div class="table-responsive">
                    {{ good_history_html|safe }}
                </div>
            </div>
        </div>
    </div>
    {% if good_physics_html %}
        <div class="container mt-5 text-center">
            <div class="row">
                <div class="col">
                    <h3>物理类成绩数据统计分析</h3>
                </div>
            </div>
        </div>
    {% endif %}
    <div class="container mt-3">
        <div class="row">
            <div class="col text-center table-responsive text-nowrap">
                <hr>
                <div class="table-responsive">
                    {{ good_physics_html|safe }}
                </div>
            </div>
        </div>
    </div>
    {% if excel_file_name %}
        <div class="container mt-5 text-center text-warning">
            <div class="row">
                <div class="col">
                    <h5>数据处理完成！
                        <button class="btn btn-outline-info">
                            <a href="{{ excel_file_name }}" style="text-decoration: none">导出excel表</a>
                        </button>
                    </h5>
                </div>
            </div>
        </div>
    {% endif %}
{% endblock %}